package com.giaothong.utils;

import android.database.sqlite.SQLiteDatabase;

import com.giaothong.db.DatabaseManager;
import com.giaothong.model.entity.LocationSearchEntity;

public class SessionData {
	private static String userId = "";
	private static String userType = "";
	/*
	 * luu tru cach hien thi ban do
	 */
	private static boolean isTraffic;
	private static boolean isStreet;
	private static boolean isSatellite;

	/**
	 * luu tru che do dinh vi
	 */
	private static boolean isGPS = true;
	private static boolean isNetwork;

	/**
	 * Store Database manager
	 */
	private static DatabaseManager databaseManager;

	/**
	 * Store databaseManager's SQLiteDatabase
	 */
	public static SQLiteDatabase db;

	/**
	 * clear all session data
	 */
	public static void clearAllSessionData() {
		databaseManager = null;

		if (db != null)
			db.close();
		db = null;

	}

	/**
	 * setter & getter
	 * 
	 * @param userId
	 */
	public static void setUserId(String userId) {
		SessionData.userId = userId;
	}

	public static String getUserId() {
		return SessionData.userId;
	}

	public static void setUserType(String userType) {
		SessionData.userType = userType;
	}

	public static String getUserType() {
		return userType;
	}

	public static void setDatabaseManager(DatabaseManager databaseManager) {
		SessionData.databaseManager = databaseManager;
	}

	public static void setDb(SQLiteDatabase db) {
		SessionData.db = db;
	}

	public static DatabaseManager getDatabaseManager() {
		return databaseManager;
	}

	public static SQLiteDatabase getDb() {
		return db;
	}

	public static void setSatellite(boolean isSatellite) {
		SessionData.isSatellite = isSatellite;
	}

	public static void setStreet(boolean isStreet) {
		SessionData.isStreet = isStreet;
	}

	public static void setTraffic(boolean isTraffic) {
		SessionData.isTraffic = isTraffic;
	}

	public static boolean isSatellite() {
		return isSatellite;
	}

	public static boolean isStreet() {
		return isStreet;
	}

	public static boolean isTraffic() {
		return isTraffic;
	}

	public static void setGPS(boolean isGPS) {
		SessionData.isGPS = isGPS;
	}

	public static void setNetwork(boolean isNetwork) {
		SessionData.isNetwork = isNetwork;
	}

	public static boolean isGPS() {
		return isGPS;
	}

	public static boolean isNetwork() {
		return isNetwork;
	}

	/**
	 * store location search Text
	 */
	public static LocationSearchEntity locationSearchEntity = new LocationSearchEntity();

}
